<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="sealte.hvpms.pojo.*,sealte.hvpms.dao.impl.MessageDAOImpl,sealte.hvpms.util.HVPMSTools" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>仓鼠网上投票系统HVPMS</title>
<link href="css/messages_add.jsp.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
function prevStep(){
	window.location.href='<%=basePath%>home/messages_viewAll.jsp';
}
</script>
</head>
<body>
<%
	UserCreate uc = (UserCreate)session.getAttribute("UserCreate");
	if(uc!=null){
		String id_str = request.getParameter("id");
		if(id_str!=null&&!id_str.equals("")&&HVPMSTools.isNum(id_str)){
			int id = Integer.parseInt(id_str);
			MessageDAOImpl mb = new MessageDAOImpl();
			Message mes = mb.getMessageByID(id);
%>
<div id="num2">
	<h2><img src="images/messages_view.png">&nbsp;系统消息--查看</h2>
</div>

<div id="num1">
<table>
	<tr>
		<th>消息主题：</th>
		<td><input type="text" name="messageTitle" size="71" id="title" value="<%=mes.getTitle() %>"/></td>
	</tr>
	<tr>
		<th valign="top">消息内容：</th>
		<td><textarea cols="60" rows="15" name="messageContent" id="content"><%=mes.getContent() %></textarea></td>
	</tr>
	<tr>
		<td></td>
		<td align="left">
		<input type="button" value="返回" onclick="prevStep()"/>
		</td>
	</tr>
</table>
</div>
<%	
		}else{
			out.println("系统错误，请联系开发者");
		}
	}else{
		out.println("谢绝跨路径访问！");
	}
%>
</body>
</html>